package com.mba.adapter;

import java.util.ArrayList;

import com.mba.activity.R;
import com.mba.bean.ContentInfo;
import com.mba.util.AsyncImageLoader;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class ChartActivityAdapter extends BaseAdapter {
	
	private Context context;
	private ArrayList<ContentInfo> contentList;
	private AsyncImageLoader imageLoader;
	public ChartActivityAdapter(Context context, ArrayList<ContentInfo> contentList) {
		this.context=context;
		this.contentList = contentList;
		imageLoader=new AsyncImageLoader();
	}
	
	@Override
	public int getCount() {
		return contentList!=null?contentList.size():0;
	}

	@Override
	public Object getItem(int arg0) {
		return arg0;
	}

	@Override
	public long getItemId(int arg0) {
		return arg0;
	}

	@Override
	public View getView(int arg0, View arg1, ViewGroup arg2) {
		if(arg1==null){
			arg1=LayoutInflater.from(context).inflate(R.layout.chart_list_item_layout, null);
		}
		TextView tv = (TextView) arg1.findViewById(R.id.brightly_replies_text);
		tv.setText("TEST Information");
		TextView tv2 = (TextView) arg1.findViewById(R.id.chart_activity_for_detail);
		final ContentInfo info = contentList.get(arg0);
		tv2.setText(info.getText());
		return arg1;
	}

}
